home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / Report Writers / Crystal Repot 9.0 Full CD version / Setup.exe / SRC / HOARDDLL.ZIP / 3rdParty / hoard / libhoard-2.0.2 / aclocal.m4 next >
Encoding:
M4 Source File  |  1999-10-11  |  22.4 KB  |  729 lines

  1. dnl aclocal.m4 generated automatically by aclocal 1.4a
  2.  
  3. dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
  4. dnl This file is free software; the Free Software Foundation
  5. dnl gives unlimited permission to copy and/or distribute it,
  6. dnl with or without modifications, as long as this notice is preserved.
  7.  
  8. dnl This program is distributed in the hope that it will be useful,
  9. dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
  10. dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
  11. dnl PARTICULAR PURPOSE.
  12.  
  13. # Do all the work for Automake.  This macro actually does too much --
  14. # some checks are only needed if your package does certain things.
  15. # But this isn't really a big deal.
  16.  
  17. # serial 1
  18.  
  19. dnl Usage:
  20. dnl AM_INIT_AUTOMAKE(package,version, [no-define])
  21.  
  22. AC_DEFUN(AM_INIT_AUTOMAKE,
  23. [AC_REQUIRE([AC_PROG_INSTALL])
  24. dnl We require 2.13 because we rely on SHELL being computed by configure.
  25. AC_PREREQ([2.13])
  26. PACKAGE=[$1]
  27. AC_SUBST(PACKAGE)
  28. VERSION=[$2]
  29. AC_SUBST(VERSION)
  30. dnl test to see if srcdir already configured
  31. if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
  32.   AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
  33. fi
  34. ifelse([$3],,
  35. AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
  36. AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
  37. AC_REQUIRE([AM_SANITY_CHECK])
  38. AC_REQUIRE([AC_ARG_PROGRAM])
  39. dnl FIXME This is truly gross.
  40. missing_dir=`cd $ac_aux_dir && pwd`
  41. AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
  42. AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
  43. AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
  44. AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
  45. AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
  46. AC_REQUIRE([AC_PROG_MAKE_SET])])
  47.  
  48. #
  49. # Check to make sure that the build environment is sane.
  50. #
  51.  
  52. AC_DEFUN(AM_SANITY_CHECK,
  53. [AC_MSG_CHECKING([whether build environment is sane])
  54. # Just in case
  55. sleep 1
  56. echo timestamp > conftestfile
  57. # Do `set' in a subshell so we don't clobber the current shell's
  58. # arguments.  Must try -L first in case configure is actually a
  59. # symlink; some systems play weird games with the mod time of symlinks
  60. # (eg FreeBSD returns the mod time of the symlink's containing
  61. # directory).
  62. if (
  63.    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
  64.    if test "[$]*" = "X"; then
  65.       # -L didn't work.
  66.       set X `ls -t $srcdir/configure conftestfile`
  67.    fi
  68.    if test "[$]*" != "X $srcdir/configure conftestfile" \
  69.       && test "[$]*" != "X conftestfile $srcdir/configure"; then
  70.  
  71.       # If neither matched, then we have a broken ls.  This can happen
  72.       # if, for instance, CONFIG_SHELL is bash and it inherits a
  73.       # broken ls alias from the environment.  This has actually
  74.       # happened.  Such a system could not be considered "sane".
  75.       AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
  76. alias in your environment])
  77.    fi
  78.  
  79.    test "[$]2" = conftestfile
  80.    )
  81. then
  82.    # Ok.
  83.    :
  84. else
  85.    AC_MSG_ERROR([newly created file is older than distributed files!
  86. Check your system clock])
  87. fi
  88. rm -f conftest*
  89. AC_MSG_RESULT(yes)])
  90.  
  91. dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
  92. dnl The program must properly implement --version.
  93. AC_DEFUN(AM_MISSING_PROG,
  94. [AC_MSG_CHECKING(for working $2)
  95. # Run test in a subshell; some versions of sh will print an error if
  96. # an executable is not found, even if stderr is redirected.
  97. # Redirect stdin to placate older versions of autoconf.  Sigh.
  98. if ($2 --version) < /dev/null > /dev/null 2>&1; then
  99.    $1=$2
  100.    AC_MSG_RESULT(found)
  101. else
  102.    $1="$3/missing $2"
  103.    AC_MSG_RESULT(missing)
  104. fi
  105. AC_SUBST($1)])
  106.  
  107. # Define a conditional.
  108.  
  109. AC_DEFUN(AM_CONDITIONAL,
  110. [AC_SUBST($1_TRUE)
  111. AC_SUBST($1_FALSE)
  112. if $2; then
  113.   $1_TRUE=
  114.   $1_FALSE='#'
  115. else
  116.   $1_TRUE='#'
  117.   $1_FALSE=
  118. fi])
  119.  
  120.  
  121. # serial 35 AC_PROG_LIBTOOL
  122. AC_DEFUN(AC_PROG_LIBTOOL,
  123. [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
  124.  
  125. # Save cache, so that ltconfig can load it
  126. AC_CACHE_SAVE
  127.  
  128. # Actually configure libtool.  ac_aux_dir is where install-sh is found.
  129. CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
  130. LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
  131. DLLTOOL="$DLLTOOL" AS="$AS" \
  132. ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
  133. $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
  134. || AC_MSG_ERROR([libtool configure failed])
  135.  
  136. # Reload cache, that may have been modified by ltconfig
  137. AC_CACHE_LOAD
  138.  
  139. # This can be used to rebuild libtool when needed
  140. LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
  141.  
  142. # Always use our own libtool.
  143. LIBTOOL='$(SHELL) $(top_builddir)/libtool'
  144. AC_SUBST(LIBTOOL)dnl
  145.  
  146. # Redirect the config.log output again, so that the ltconfig log is not
  147. # clobbered by the next message.
  148. exec 5>>./config.log
  149. ])
  150.  
  151. AC_DEFUN(AC_LIBTOOL_SETUP,
  152. [AC_PREREQ(2.13)dnl
  153. AC_REQUIRE([AC_ENABLE_SHARED])dnl
  154. AC_REQUIRE([AC_ENABLE_STATIC])dnl
  155. AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
  156. AC_REQUIRE([AC_CANONICAL_HOST])dnl
  157. AC_REQUIRE([AC_CANONICAL_BUILD])dnl
  158. AC_REQUIRE([AC_PROG_RANLIB])dnl
  159. AC_REQUIRE([AC_PROG_CC])dnl
  160. AC_REQUIRE([AC_PROG_LD])dnl
  161. AC_REQUIRE([AC_PROG_NM])dnl
  162. AC_REQUIRE([AC_SYS_NM_PARSE])dnl
  163. AC_REQUIRE([AC_SYS_SYMBOL_UNDERSCORE])dnl
  164. AC_REQUIRE([AC_PROG_LN_S])dnl
  165. dnl
  166.  
  167. # Check for any special flags to pass to ltconfig.
  168. #
  169. # the following will cause an existing older ltconfig to fail, so
  170. # we ignore this at the expense of the cache file... Checking this 
  171. # will just take longer ... bummer!
  172. #libtool_flags="--cache-file=$cache_file"
  173. #
  174. test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
  175. test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
  176. test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
  177. test "$lt_dlopen" = yes && libtool_flags="$libtool_flags --enable-dlopen"
  178. test "$silent" = yes && libtool_flags="$libtool_flags --silent"
  179. test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
  180. test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
  181.  
  182. # Some flags need to be propagated to the compiler or linker for good
  183. # libtool support.
  184. case "$host" in
  185. *-*-irix6*)
  186.   # Find out which ABI we are using.
  187.   echo '[#]line __oline__ "configure"' > conftest.$ac_ext
  188.   if AC_TRY_EVAL(ac_compile); then
  189.     case "`/usr/bin/file conftest.o`" in
  190.     *32-bit*)
  191.       LD="${LD-ld} -32"
  192.       ;;
  193.     *N32*)
  194.       LD="${LD-ld} -n32"
  195.       ;;
  196.     *64-bit*)
  197.       LD="${LD-ld} -64"
  198.       ;;
  199.     esac
  200.   fi
  201.   rm -rf conftest*
  202.   ;;
  203.  
  204. *-*-sco3.2v5*)
  205.   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
  206.   SAVE_CFLAGS="$CFLAGS"
  207.   CFLAGS="$CFLAGS -belf"
  208.   AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
  209.     [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
  210.   if test x"$lt_cv_cc_needs_belf" != x"yes"; then
  211.     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
  212.     CFLAGS="$SAVE_CFLAGS"
  213.   fi
  214.   ;;
  215.  
  216. *-*-cygwin*)
  217.   AC_SYS_LIBTOOL_CYGWIN
  218.   ;;
  219.  
  220. esac
  221.  
  222. # enable the --disable-libtool-lock switch
  223.  
  224. AC_ARG_ENABLE(libtool-lock,
  225. [  --disable-libtool-lock  force libtool not to do file locking],
  226. need_locks=$enableval,
  227. need_locks=yes)
  228.  
  229. if test x"$need_locks" = xno; then
  230.   libtool_flags="$libtool_flags --disable-lock"
  231. fi
  232. ])
  233.  
  234. # AC_LIBTOOL_DLOPEN - check for dlopen support
  235. AC_DEFUN(AC_LIBTOOL_DLOPEN, [lt_dlopen=yes])
  236.  
  237. # AC_ENABLE_SHARED - implement the --enable-shared flag
  238. # Usage: AC_ENABLE_SHARED[(DEFAULT)]
  239. #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
  240. #   `yes'.
  241. AC_DEFUN(AC_ENABLE_SHARED,
  242. [define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
  243. AC_ARG_ENABLE(shared,
  244. changequote(<<, >>)dnl
  245. <<  --enable-shared[=PKGS]  build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
  246. changequote([, ])dnl
  247. [p=${PACKAGE-default}
  248. case "$enableval" in
  249. yes) enable_shared=yes ;;
  250. no) enable_shared=no ;;
  251. *)
  252.   enable_shared=no
  253.   # Look at the argument we got.  We use all the common list separators.
  254.   IFS="${IFS=     }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
  255.   for pkg in $enableval; do
  256.     if test "X$pkg" = "X$p"; then
  257.       enable_shared=yes
  258.     fi
  259.   done
  260.   IFS="$ac_save_ifs"
  261.   ;;
  262. esac],
  263. enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
  264. ])
  265.  
  266. # AC_DISABLE_SHARED - set the default shared flag to --disable-shared
  267. AC_DEFUN(AC_DISABLE_SHARED,
  268. [AC_ENABLE_SHARED(no)])
  269.  
  270. # AC_ENABLE_STATIC - implement the --enable-static flag
  271. # Usage: AC_ENABLE_STATIC[(DEFAULT)]
  272. #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
  273. #   `yes'.
  274. AC_DEFUN(AC_ENABLE_STATIC,
  275. [define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
  276. AC_ARG_ENABLE(static,
  277. changequote(<<, >>)dnl
  278. <<  --enable-static[=PKGS]  build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
  279. changequote([, ])dnl
  280. [p=${PACKAGE-default}
  281. case "$enableval" in
  282. yes) enable_static=yes ;;
  283. no) enable_static=no ;;
  284. *)
  285.   enable_static=no
  286.   # Look at the argument we got.  We use all the common list separators.
  287.   IFS="${IFS=     }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
  288.   for pkg in $enableval; do
  289.     if test "X$pkg" = "X$p"; then
  290.       enable_static=yes
  291.     fi
  292.   done
  293.   IFS="$ac_save_ifs"
  294.   ;;
  295. esac],
  296. enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
  297. ])
  298.  
  299. # AC_DISABLE_STATIC - set the default static flag to --disable-static
  300. AC_DEFUN(AC_DISABLE_STATIC,
  301. [AC_ENABLE_STATIC(no)])
  302.  
  303.  
  304. # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
  305. # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
  306. #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
  307. #   `yes'.
  308. AC_DEFUN(AC_ENABLE_FAST_INSTALL,
  309. [define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
  310. AC_ARG_ENABLE(fast-install,
  311. changequote(<<, >>)dnl
  312. <<  --enable-fast-install[=PKGS]  optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
  313. changequote([, ])dnl
  314. [p=${PACKAGE-default}
  315. case "$enableval" in
  316. yes) enable_fast_install=yes ;;
  317. no) enable_fast_install=no ;;
  318. *)
  319.   enable_fast_install=no
  320.   # Look at the argument we got.  We use all the common list separators.
  321.   IFS="${IFS=     }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
  322.   for pkg in $enableval; do
  323.     if test "X$pkg" = "X$p"; then
  324.       enable_fast_install=yes
  325.     fi
  326.   done
  327.   IFS="$ac_save_ifs"
  328.   ;;
  329. esac],
  330. enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
  331. ])
  332.  
  333. # AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
  334. AC_DEFUN(AC_DISABLE_FAST_INSTALL,
  335. [AC_ENABLE_FAST_INSTALL(no)])
  336.  
  337.  
  338. # AC_PROG_LD - find the path to the GNU or non-GNU linker
  339. AC_DEFUN(AC_PROG_LD,
  340. [AC_ARG_WITH(gnu-ld,
  341. [  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
  342. test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
  343. AC_REQUIRE([AC_PROG_CC])dnl
  344. AC_REQUIRE([AC_CANONICAL_HOST])dnl
  345. AC_REQUIRE([AC_CANONICAL_BUILD])dnl
  346. ac_prog=ld
  347. if test "$ac_cv_prog_gcc" = yes; then
  348.   # Check if gcc -print-prog-name=ld gives a path.
  349.   AC_MSG_CHECKING([for ld used by GCC])
  350.   ac_prog=`($CC -print-prog-name=ld) 2>&5`
  351.   case "$ac_prog" in
  352.     # Accept absolute paths.
  353. changequote(,)dnl
  354.     /* | [A-Za-z]:[\\/]*)
  355.       re_direlt='/[^/][^/]*/\.\./'
  356. changequote([,])dnl
  357.       # Canonicalize the path of ld
  358.       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
  359.       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
  360.     ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
  361.       done
  362.       test -z "$LD" && LD="$ac_prog"
  363.       ;;
  364.   "")
  365.     # If it fails, then pretend we aren't using GCC.
  366.     ac_prog=ld
  367.     ;;
  368.   *)
  369.     # If it is relative, then search for the first ld in PATH.
  370.     with_gnu_ld=unknown
  371.     ;;
  372.   esac
  373. elif test "$with_gnu_ld" = yes; then
  374.   AC_MSG_CHECKING([for GNU ld])
  375. else
  376.   AC_MSG_CHECKING([for non-GNU ld])
  377. fi
  378. AC_CACHE_VAL(ac_cv_path_LD,
  379. [if test -z "$LD"; then
  380.   IFS="${IFS=     }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
  381.   for ac_dir in $PATH; do
  382.     test -z "$ac_dir" && ac_dir=.
  383.     if test -f "$ac_dir/$ac_prog"; then
  384.       ac_cv_path_LD="$ac_dir/$ac_prog"
  385.       # Check to see if the program is GNU ld.  I'd rather use --version,
  386.       # but apparently some GNU ld's only accept -v.
  387.       # Break only if it was the GNU/non-GNU ld that we prefer.
  388.       if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
  389.     test "$with_gnu_ld" != no && break
  390.       else
  391.     test "$with_gnu_ld" != yes && break
  392.       fi
  393.     fi
  394.   done
  395.   IFS="$ac_save_ifs"
  396. else
  397.   ac_cv_path_LD="$LD" # Let the user override the test with a path.
  398. fi])
  399. LD="$ac_cv_path_LD"
  400. if test -n "$LD"; then
  401.   AC_MSG_RESULT($LD)
  402. else
  403.   AC_MSG_RESULT(no)
  404. fi
  405. test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
  406. AC_SUBST(LD)
  407. AC_PROG_LD_GNU
  408. ])
  409.  
  410. AC_DEFUN(AC_PROG_LD_GNU,
  411. [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
  412. [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
  413. if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
  414.   ac_cv_prog_gnu_ld=yes
  415. else
  416.   ac_cv_prog_gnu_ld=no
  417. fi])
  418. ])
  419.  
  420. # AC_PROG_NM - find the path to a BSD-compatible name lister
  421. AC_DEFUN(AC_PROG_NM,
  422. [AC_MSG_CHECKING([for BSD-compatible nm])
  423. AC_CACHE_VAL(ac_cv_path_NM,
  424. [if test -n "$NM"; then
  425.   # Let the user override the test.
  426.   ac_cv_path_NM="$NM"
  427. else
  428.   IFS="${IFS=     }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
  429.   for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
  430.     test -z "$ac_dir" && ac_dir=.
  431.     if test -f $ac_dir/nm; then
  432.       # Check to see if the nm accepts a BSD-compat flag.
  433.       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
  434.       #   nm: unknown option "B" ignored
  435.       if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
  436.     ac_cv_path_NM="$ac_dir/nm -B"
  437.     break
  438.       elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
  439.     ac_cv_path_NM="$ac_dir/nm -p"
  440.     break
  441.       else
  442.     ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
  443.     continue # so that we can try to find one that supports BSD flags
  444.       fi
  445.     fi
  446.   done
  447.   IFS="$ac_save_ifs"
  448.   test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
  449. fi])
  450. NM="$ac_cv_path_NM"
  451. AC_MSG_RESULT([$NM])
  452. AC_SUBST(NM)
  453. ])
  454.  
  455. # AC_SYS_NM_PARSE - Check for command to grab the raw symbol name followed
  456. # by C symbol name from nm.
  457. AC_DEFUN(AC_SYS_NM_PARSE,
  458. [AC_REQUIRE([AC_CANONICAL_HOST])dnl
  459. AC_REQUIRE([AC_PROG_NM])dnl
  460. # Check for command to grab the raw symbol name followed by C symbol from nm.
  461. AC_MSG_CHECKING([command to parse $NM output])
  462. AC_CACHE_VAL(ac_cv_sys_global_symbol_pipe,
  463. [# These are sane defaults that work on at least a few old systems.
  464. # {They come from Ultrix.  What could be older than Ultrix?!! ;)}
  465.  
  466. changequote(,)dnl
  467. # Character class describing NM global symbol codes.
  468. ac_symcode='[BCDEGRST]'
  469.  
  470. # Regexp to match symbols that can be accessed directly from C.
  471. ac_sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
  472.  
  473. # Transform the above into a raw symbol and a C symbol.
  474. ac_symxfrm='\1 \2\3 \3'
  475.  
  476. # Transform an extracted symbol line into a proper C declaration
  477. ac_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
  478.  
  479. # Define system-specific variables.
  480. case "$host_os" in
  481. aix*)
  482.   ac_symcode='[BCDT]'
  483.   ;;
  484. cygwin* | mingw*)
  485.   ac_symcode='[ABCDGISTW]'
  486.   ;;
  487. hpux*)
  488.   ac_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^. .* \(.*\)$/extern char \1;/p'"
  489.   ;;
  490. irix*)
  491.   ac_symcode='[BCDEGRST]'
  492.   ;;
  493. solaris*)
  494.   ac_symcode='[BDT]'
  495.   ;;
  496. esac
  497.  
  498. # If we're using GNU nm, then use its standard symbol codes.
  499. if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
  500.   ac_symcode='[ABCDGISTW]'
  501. fi
  502. changequote([,])dnl
  503.  
  504. # Try without a prefix undercore, then with it.
  505. for ac_symprfx in "" "_"; do
  506.  
  507.   ac_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[     ]\($ac_symcode\)[     ][     ]*\($ac_symprfx\)$ac_sympat$/$ac_symxfrm/p'"
  508.  
  509.   # Check to see that the pipe works correctly.
  510.   ac_pipe_works=no
  511.   rm -f conftest.$ac_ext
  512.   cat > conftest.$ac_ext <<EOF
  513. #ifdef __cplusplus
  514. extern "C" {
  515. #endif
  516. char nm_test_var;
  517. void nm_test_func(){}
  518. #ifdef __cplusplus
  519. }
  520. #endif
  521. int main(){nm_test_var='a';nm_test_func;return 0;}
  522. EOF
  523.  
  524.   if AC_TRY_EVAL(ac_compile); then
  525.     # Now try to grab the symbols.
  526.     ac_nlist=conftest.nm
  527.   
  528.     if AC_TRY_EVAL(NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then
  529.  
  530.       # Try sorting and uniquifying the output.
  531.       if sort "$ac_nlist" | uniq > "$ac_nlist"T; then
  532.     mv -f "$ac_nlist"T "$ac_nlist"
  533.       else
  534.     rm -f "$ac_nlist"T
  535.       fi
  536.  
  537.       # Make sure that we snagged all the symbols we need.
  538.       if egrep ' nm_test_var$' "$ac_nlist" >/dev/null; then
  539.     if egrep ' nm_test_func$' "$ac_nlist" >/dev/null; then
  540.       cat <<EOF > conftest.c
  541. #ifdef __cplusplus
  542. extern "C" {
  543. #endif
  544.  
  545. EOF
  546.       # Now generate the symbol file.
  547.       eval "$ac_global_symbol_to_cdecl"' < "$ac_nlist" >> conftest.c'
  548.  
  549.       cat <<EOF >> conftest.c
  550. #if defined (__STDC__) && __STDC__
  551. # define lt_ptr_t void *
  552. #else
  553. # define lt_ptr_t char *
  554. # define const
  555. #endif
  556.  
  557. /* The mapping between symbol names and symbols. */
  558. const struct {
  559.   const char *name;
  560.   lt_ptr_t address;
  561. }
  562. changequote(,)dnl
  563. lt_preloaded_symbols[] =
  564. changequote([,])dnl
  565. {
  566. EOF
  567.     sed 's/^. \(.*\) \(.*\)$/  {"\2", (lt_ptr_t) \&\2},/' < "$ac_nlist" >> conftest.c
  568.     cat <<\EOF >> conftest.c
  569.   {0, (lt_ptr_t) 0}
  570. };
  571.  
  572. #ifdef __cplusplus
  573. }
  574. #endif
  575. EOF
  576.       # Now try linking the two files.
  577.       mv conftest.$ac_objext conftestm.$ac_objext
  578.       ac_save_LIBS="$LIBS"
  579.       ac_save_CFLAGS="$CFLAGS"
  580.       LIBS="conftestm.$ac_objext"
  581.       CFLAGS="$CFLAGS$no_builtin_flag"
  582.       if AC_TRY_EVAL(ac_link) && test -s conftest; then
  583.         ac_pipe_works=yes
  584.       else
  585.         echo "configure: failed program was:" >&AC_FD_CC
  586.         cat conftest.c >&AC_FD_CC
  587.       fi
  588.       LIBS="$ac_save_LIBS"
  589.       CFLAGS="$ac_save_CFLAGS"
  590.     else
  591.       echo "cannot find nm_test_func in $ac_nlist" >&AC_FD_CC
  592.     fi
  593.       else
  594.     echo "cannot find nm_test_var in $ac_nlist" >&AC_FD_CC
  595.       fi
  596.     else
  597.       echo "cannot run $ac_cv_sys_global_symbol_pipe" >&AC_FD_CC
  598.     fi
  599.   else
  600.     echo "$progname: failed program was:" >&AC_FD_CC
  601.     cat conftest.c >&AC_FD_CC
  602.   fi
  603.   rm -rf conftest*
  604.  
  605.   # Do not use the global_symbol_pipe unless it works.
  606.   if test "$ac_pipe_works" = yes; then
  607.     if test x"$ac_symprfx" = x"_"; then
  608.       ac_cv_sys_symbol_underscore=yes
  609.     else
  610.       ac_cv_sys_symbol_underscore=no
  611.     fi
  612.     break
  613.   else
  614.     ac_cv_sys_global_symbol_pipe=
  615.   fi
  616. done
  617. ])
  618.  
  619. ac_result=yes
  620. if test -z "$ac_cv_sys_global_symbol_pipe"; then
  621.    ac_result=no
  622. fi
  623. AC_MSG_RESULT($ac_result)
  624. ])
  625.  
  626. # AC_SYS_LIBTOOL_CYGWIN - find tools needed on cygwin
  627. AC_DEFUN(AC_SYS_LIBTOOL_CYGWIN,
  628. [AC_CHECK_TOOL(DLLTOOL, dlltool, false)
  629. AC_CHECK_TOOL(AS, as, false)
  630. ])
  631.  
  632. # AC_SYS_SYMBOL_UNDERSCORE - does the compiler prefix global symbols
  633. #                            with an underscore?
  634. AC_DEFUN(AC_SYS_SYMBOL_UNDERSCORE,
  635. [AC_REQUIRE([AC_PROG_NM])dnl
  636. AC_REQUIRE([AC_SYS_NM_PARSE])dnl
  637. AC_MSG_CHECKING([for _ prefix in compiled symbols])
  638. AC_CACHE_VAL(ac_cv_sys_symbol_underscore,
  639. [ac_cv_sys_symbol_underscore=no
  640. cat > conftest.$ac_ext <<EOF
  641. void nm_test_func(){}
  642. int main(){nm_test_func;return 0;}
  643. EOF
  644. if AC_TRY_EVAL(ac_compile); then
  645.   # Now try to grab the symbols.
  646.   ac_nlist=conftest.nm
  647.   if AC_TRY_EVAL(NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then
  648.     # See whether the symbols have a leading underscore.
  649.     if egrep '^. _nm_test_func' "$ac_nlist" >/dev/null; then
  650.       ac_cv_sys_symbol_underscore=yes
  651.     else
  652.       if egrep '^. nm_test_func ' "$ac_nlist" >/dev/null; then
  653.     :
  654.       else
  655.     echo "configure: cannot find nm_test_func in $ac_nlist" >&AC_FD_CC
  656.       fi
  657.     fi
  658.   else
  659.     echo "configure: cannot run $ac_cv_sys_global_symbol_pipe" >&AC_FD_CC
  660.   fi
  661. else
  662.   echo "configure: failed program was:" >&AC_FD_CC
  663.   cat conftest.c >&AC_FD_CC
  664. fi
  665. rm -rf conftest*
  666. ])
  667. AC_MSG_RESULT($ac_cv_sys_symbol_underscore)
  668. USE_SYMBOL_UNDERSCORE=${ac_cv_sys_symbol_underscore=no}
  669. AC_SUBST(USE_SYMBOL_UNDERSCORE)dnl
  670. ])
  671.  
  672. # AC_CHECK_LIBM - check for math library
  673. AC_DEFUN(AC_CHECK_LIBM, [
  674. AC_CHECK_LIB(mw, _mwvalidcheckl)
  675. AC_CHECK_LIB(m, cos)
  676. ])
  677.  
  678. # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
  679. # the libltdl convenience library, adds --enable-ltdl-convenience to
  680. # the configure arguments.  Note that LIBLTDL is not AC_SUBSTed, nor
  681. # is AC_CONFIG_SUBDIRS called.  If DIR is not provided, it is assumed
  682. # to be `${top_builddir}/libltdl'.  Make sure you start DIR with
  683. # '${top_builddir}/' (note the single quotes!) if your package is not
  684. # flat, and, if you're not using automake, define top_builddir as
  685. # appropriate in the Makefiles.
  686. AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [
  687.   case "$enable_ltdl_convenience" in
  688.   no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
  689.   "") enable_ltdl_convenience=yes
  690.       ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
  691.   esac
  692.   LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
  693. ])
  694.  
  695. # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
  696. # the libltdl installable library, and adds --enable-ltdl-install to
  697. # the configure arguments.  Note that LIBLTDL is not AC_SUBSTed, nor
  698. # is AC_CONFIG_SUBDIRS called.  If DIR is not provided, it is assumed
  699. # to be `${top_builddir}/libltdl'.  Make sure you start DIR with
  700. # '${top_builddir}/' (note the single quotes!) if your package is not
  701. # flat, and, if you're not using automake, define top_builddir as
  702. # appropriate in the Makefiles.
  703. # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
  704. AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [
  705.   AC_CHECK_LIB(ltdl, main, LIBLTDL="-lltdl", [
  706.     case "$enable_ltdl_install" in
  707.     no) AC_MSG_WARN([libltdl not installed, but installation disabled]) ;;
  708.     "") enable_ltdl_install=yes
  709.         ac_configure_args="$ac_configure_args --enable-ltdl-install" ;;
  710.     esac
  711.   ])
  712.   if test x"$enable_ltdl_install" != x"no"; then
  713.     LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
  714.   fi
  715. ])
  716.  
  717. dnl old names
  718. AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
  719. AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
  720. AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
  721. AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
  722. AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
  723. AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
  724. AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
  725. AC_DEFUN(AM_SYS_NM_PARSE, [indir([AC_SYS_NM_PARSE])])dnl
  726. AC_DEFUN(AM_SYS_SYMBOL_UNDERSCORE, [indir([AC_SYS_SYMBOL_UNDERSCORE])])dnl
  727. AC_DEFUN(AM_SYS_LIBTOOL_CYGWIN, [indir([AC_SYS_LIBTOOL_CYGWIN])])dnl
  728.  
  729.